/*
* @Author: yanxiaoli
* @Date:   2018-12-21 11:29:18
* @Last Modified by:   yanxiaoli
* @Last Modified time: 2018-12-21 14:50:18
*/
$(function(){
    $(".menu li").hover(function(){
      $(this).addClass("active").siblings().removeClass("active");
    });

    // 右侧滚动跟随
        var jltop = 50+$('.yuleRight').height()-$('.fixed_adv_right').height()-20;
        $(window).scroll(function() {
           if(document.body.scrollTop >= document.documentElement.scrollTop){
                var mtop = document.body.scrollTop;
            }else{
                var mtop = document.documentElement.scrollTop;
            }   
            if (mtop > jltop) {
                console.log(mtop);
                $('.fixed_adv_right').css({ 'z-index': '1000', 'position': 'fixed', 'top': '0'})
            } else {
                $('.fixed_adv_right').css({ 'z-index': 'auto', 'position': 'static', 'top': 'auto' })
            }   
        }); 
});